<script type="text/javascript">
$(function(){
  $("#languageSupport").multiSelect();
});
</script>
<h2>Edit Language Support</h2>
<div class="content-inner">
  <form action="<?=site_url(array('c' => 'cms_settings', 'm' => 'edit_lang', 'id' => $setting['id']))?>" enctype="multipart/form-data" method="post">
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="form-table">
    <tbody>
      <tr>
        <th>Language Support: </th>
        <td>
          <?php
          	$language_support = unserialize($setting['language_support']);
          ?>
          <select id="languageSupport" name="language_support[]" title="Please select" size="3" multiple="true">
            <?php foreach($countries as $item):?>
            <?php if(array_search($item['country_id'], $language_support) !== FALSE):?>
            <option value="<?=$item['country_id']?>" selected="true"><?=$item['name']?></option>
            <?php else:?>
            <option value="<?=$item['country_id']?>"><?=$item['name']?></option>
            <?php endif;?>
            <?php endforeach;?>
          </select>
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>
          <br/>
          <input type="button" class="input-button" onClick="javascript:history.back();" value="Cancel">
          <input name="Submit" type="submit" class="ins" value="Save"></td>
      </tr>
    </tbody>
  </table>
  </form>
</div>